<template>
  <div class="forget-box">
    <div class="forget-main">
      <div class="clearfix form-main">
        <el-form ref="form" :model="form" label-width="80px">
          <el-form-item label="账号" prop="user">
            <el-input v-model="form.user"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="onSubmit">提交</el-button>
          </el-form-item>
        </el-form>
      </div>
    </div>
  </div>
</template>
<script>
import { forgetPass } from "api";
export default {
  data() {
    return {
      geetestId: "geetestId" + 123,
      form: {
        user: ""
      }
    };
  },
  mounted() {},
  methods: {
    onSubmit() {
      this.$promise.post(forgetPass, this.form).then(resp => {
        console.log(resp.sess_id);
        if (resp.status == 1) {
          this.$message({
            message: "发送邮件成功,请登录邮箱修改密码",
            type: "success"
          });
        } else {
          this.$message({
            message: resp.msg,
            type: "error"
          });
        }
        // this.$router.push({
        //   path:'/bindPass',
        //   query:{
        //     sess_id:resp.sess_id
        //   }
        // })
        // if(resp.status==1){
        //   this.$router.replace({path:"list"})
        // }else{
        //   alert(resp.msg)
        // }
      });
    }
  }
};
</script>
<style lang="scss" scoped>
.forget-box {
  width: 100%;
  height: 100%;
  background: #666;
  position: fixed;
  .forget-main {
    position: absolute;
    width: 80%;
    max-width: 400px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
  }
  .form-main {
    padding-top: 15px;
    padding-bottom: 15px;
    padding-left: 15px;
    padding-right: 15px;
  }
}
</style>

